using System;

namespace ZerAx.Roguelike
{
    [Flags]
    public enum Dir : byte
    {
        West = 1,
        South = 2,
        East = 4,
        North = 8,
        All = 15,
    }

    public static class DirExt
    {
        public static Dir RotateCw(this Dir dir) => (Dir)((byte)dir << 1 | (byte)dir >> 3) & Dir.All;
        public static Dir RotateCcw(this Dir dir) => (Dir)((byte)dir >> 1 | (byte)dir << 3) & Dir.All;
    }
}